import {NgModule} from '@angular/core';
import {Routes, RouterModule} from '@angular/router';
import {ServiceaComponent} from './modules/servicea/servicea.component';
import {ServicebComponent} from './modules/serviceb/serviceb.component';
import {AuthGuard} from './common/auth.guard';
import {IndexComponent} from './common/index/index.component';

const routes: Routes = [
  {path: '', component: IndexComponent},
  {path: 'login', component: IndexComponent, canActivate: [AuthGuard]},
  {path: 'servicea', component: ServiceaComponent, canActivate: [AuthGuard]},
  {path: 'serviceb', component: ServicebComponent, canActivate: [AuthGuard]},
];

@NgModule({
  imports: [RouterModule.forRoot(routes)],
  exports: [RouterModule]
})
export class AppRoutingModule {
}
